import {createApp} from 'vue';
import App from './App.vue';
import store from './store';
import router from './router';
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
import ElementPlus from 'element-plus';
import zhCn from 'element-plus/dist/locale/zh-cn.mjs';
import {permission} from './directives/permission';

import 'element-plus/dist/index.css';
import './style/index.scss';

// 创建vue实例
const app = createApp(App);

app.use(store);
app.use(router);

app.use(ElementPlus, {locale: zhCn});
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

app.directive('permission', permission);

app.mount('#app');
